package com.wyfan.scaffold.feign;

//import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * feign 远程调用
 *
 * 说明：
 * 1.在feign中获取配置文件属性url 或 value， ： ulr = "${rpc.url}"
 * 2.value 指向服务名 ， url 指向实际访问地址，当url的优先级比value高
 * 3.参数需要用@RequestParam 表述
 * 4.熔断 ：feign.hystrix.enabled=true 配置开启熔断
 */
//@FeignClient(value = "null",url = "localhost:8500",fallbackFactory = HystrixClientFallback.class)
//@FeignClient(value = "spring-scaffold",fallbackFactory = HystrixClientFallback.class)
public interface FeignDemo {

    @RequestMapping(value = "/api",method = RequestMethod.GET)
    String api(@RequestParam("param")String param);
}



